package com.mybatis.test.mapper;


import com.demo.pojo.User;
import com.mybatis.annotation.Insert;
import com.mybatis.annotation.Select;

import java.util.List;


public interface UserMapper {
    @Select(value = "select id, username, password from user where username = ? and password = ?; ",
            resultType = User.class)
    User getByUsernameAndPassword(String username, String password);

    @Select(value = "select id, username, password from user;", resultType = User.class)
    List<User> getAll();

    @Insert("insert into user values (default, ?, ?);")
    int insertUser(User user);

}
